﻿class Program2
{
    static void Main2()
    {
        int total = 26;
        int n = 5;
        var segments = IntervalSegmentation.SegmentInterval(total, n);
        ValueTuple<int,int> _segment = IntervalSegmentation.FindIntervalContainingValue(segments, 22);

        Console.WriteLine($"总数 {total} 被平均分成 {n} 份，各分段信息如下：");
        for (int i = 0; i < segments.Count; i++)
        {
            var segment = segments[i];
            Console.WriteLine($"分段 {i + 1}: 开始值 {segment.start}, 结束值 {segment.end}");
        }
    }
}